#!/bin/sh
set -ex
. ${0%/*}/.dirset
path_o=${PRODADMDIR}/obj
path_f=${PRODADMDIR}/src/mod

module load intel
module load openmpi_ib
module load netcdf

modfile="wam_topo_module wam_source_module wam_output_module \
wam_propagation_module preproc_module wam_coldstart_module \
wam_restart_module wam_initial_module wam_print_module \
preproc_user_module wam_radiation_module wam_user_module \
wam_print_user_module wam_assi_module"

cd $path_o

for code in $modfile
do
   rm -f ${code}.f90 ${code}.o
   cp ${path_f}/${code}.f90 ${path_o}/${code}.f90
   mpif90 -c ${code}.f90
   rm -f ${code}.f90
done
